package com.lh.java.structure;

/**堆栈数组实现
 * @author lenovo
 * 
 */
public class StackArray {
	private Object[] s;
	private int n;

	StackArray(int maxN) {
		s = new Object[maxN];
		n = 0;
	}

	boolean isEmpty() {
		return (n == 0);
	}

	void push(Object item) {
		s[n++] = item;
	}

	Object pop() {
		Object t = s[--n];
		s[n] = null;
		return t;
	}
}
